home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / wx_lib10.zoo / wx_clear.c < prev    next >
C/C++ Source or Header  |  1992-08-01  |  1KB  |  45 lines

  1. #include <wx_lib.h>
  2.  
  3. /*
  4.  * This routine will clear the interior of the window described by the Window
  5.  * structure ws, by painting a filled rectangle of color 0 over the work space.
  6.  * If there's a better (i.e., faster) way to do this, please let me know.
  7.  *
  8.  * Arguments:    A pointer to the Window structure representing the window we're
  9.  *                working on.
  10.  */
  11. void    wx_clear(ws)
  12. Window    *ws;
  13. {
  14.     /*
  15.      * This is the array into which we put the coordinates (upper left and
  16.      * lower right) for the rectangle.
  17.      */
  18.     int     array[4];
  19.  
  20.     /*
  21.      * Put the appropriate values in the VDI array.
  22.      */
  23.     array[0] = ws->work.g_x;
  24.     array[1] = ws->work.g_y;
  25.     /*
  26.      * For the lower-right corner, subtract one to make up for the fact that
  27.      * the width is figured from 1, rather than 0.
  28.      */
  29.     array[2] = ws->work.g_x + ws->work.g_w - 1;
  30.     array[3] = ws->work.g_y + ws->work.g_h - 1;
  31.     /*
  32.      * Turn off the mouse, so it won't get written over.
  33.      */
  34.     graf_mouse(M_OFF,NULL);
  35.     /*
  36.      * Draw the filled rectangle (is there a faster way to do this?  Malloc a
  37.      * chunk of memory, bzero it and blit it to the screen?  Must check).
  38.      */
  39.     vr_recfl(ws->vdih,array);
  40.     /*
  41.      * Turn the mouse back on, so people can use it.
  42.      */
  43.     graf_mouse(M_ON,NULL);
  44. }
  45.